/*
 * ===================================================================
 *  
 *      Filename:  log_client_mutex_sem.c
 *
 *   Description:  This file is the implement for the semphore.The sem
 *                 will be used to protect the shared memory.
 *
 *       Version:  1.0
 *        Create:  2010/07/13
 *
 *        Author:  Keven Zhu     kevenzhu@tencent.com
 *     Copyright:  Reserved by Tencent.com Co.ltd
 *          
 * ====================================================================
 */
#ifndef __LOG_CLIENT_MUTEX__
#define __LOG_CLIENT_MUTEX__

/* post the semphore(unlock)
 *
 * Notice:initialize_hplog_mutex_sem() must be called firstly
 *
 * return value:
 * positive means failure,error could be found in the head file or with the help of log_error();
 * 0 means ok*/
int hplog_sem_post();

/* fetch the semphore(lock)
 *
 * Notice:initialize_hplog_mutex_sem() must be called firstly
 *
 * return value:
 * positive means failure,error could be found in the head file or with the help of log_error();
 * 0 means ok*/
int hplog_sem_wait();

/* initialze the mutex semphone
 * 
 * return value:
 * positive means failure,error could be found in the head file or with the help of log_error();
 * 0 means ok(launched)*/
int initialize_hplog_mutex_sem(int source);
#endif

